import logging, time

logging.basicConfig(level=logging.INFO,
                    datefmt="%H:%M:%S",
                    format="%(asctime)s|%(filename)s:%(lineno)s: %(message)s",
                    filename="test.log"
                    )
logger = logging.getLogger(name="object detection")

timeMap={}

def timeStart(msg):
    t = time.time()
    timeMap[msg] = t

def timeEnd(msg):
    if timeMap.__contains__(msg):
        res = "[%s]  use %.2f ms"%( msg, ( time.time()-timeMap[msg] ) * 1000) 
        print(res)
        return res
    else:
        print("not found timeStart")